<template>
  <div class="container">
    <!-- <el-page-header @back="goBack" content="预定详情"> </el-page-header> -->
    <div class="title">会 议 室</div>
    <div class="context">{{ form.会议室名称 }}</div>
    <div class="title">会议时间</div>
    <div class="context">
      {{ form.预订日期 + ' ' + form.开始时间 + '至' + form.结束时间 }}
      <!-- <el-button
        style="margin-left: 20px"
        type="primary"
        size="mini"
        @click="selectDateTime"
        >调 整 时 间</el-button
      > -->
    </div>
    <div class="title">预订人员</div>
    <div class="context">
      {{ form.预订人员 }}
    </div>
    <div class="title">联系电话</div>
    <div class="context">
      {{ form.联系电话 }}
    </div>
    <div class="title">所属部门</div>
    <div class="context">
      {{ form.所属部门 }}
    </div>
    <div class="title">预订状态</div>
    <div class="context">
      {{ form.预订状态 }}
    </div>
    <div class="title">服务要求</div>
    <div class="context">
      {{ form.服务需求 }}
      <!-- <el-input
        type="textarea"
        :rows="3"
        placeholder="请输入内容"
        v-model="form.服务需求"
        disabled
      >
      </el-input> -->
    </div>
    <!-- <div class="title">反馈信息</div>
    <div class="context">
      <el-input
        type="textarea"
        :rows="3"
        placeholder="请输入内容"
        v-model="feedbackInfo"
      >
      </el-input>
    </div> -->
    <div style="text-align: center; height: 300px">
      <!-- <el-result :icon="formResult.icon" :title="formResult.title"> </el-result> -->
      <el-button type="danger" @click="changeMeeting">修改会议</el-button>
      <el-button type="primary" @click="deleteMeetingInfo">取消会议</el-button>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      feedbackInfo: '',
      VID: '0',
      ID: '',
      formResult: {
        icon: 'warning',
      },
      form: {
      }
    }
  },
  beforeRouteEnter (to, from, next) {
    // 好像直接带回来了，不需要赋值
    // if (from.name === "ExamineCRDateTime") {
    //   next((vm) => {
    //     vm.form.开始时间 = from.params.开始时间
    //     vm.form.结束时间 = from.params.结束时间
    //   })
    // } else 
    if (from.name === "ExamineCRList") {
      next((vm) => {
        vm.ID = from.params.ID
        vm.getMeetingOrderInfoOfMyDetail()
      })
    }
    else {
      next((vm) => {
        vm.getMeetingOrderInfoOfMyDetail()
      })
    }
  },
  methods: {
    async deleteMeetingInfo () {
      const _self = this;
      var url = 'ConferenceRoom/DeleteMeetingInfo?ID=' + this.ID
      const { data } = await this.$Http.get(url)
      console.log(data)
      if (data.IsSucess) {
        this.$message.success('删除成功');
        _self.goBack()
      } else {
        this.$message.error('删除失败，' + data.Message);
      }
    },
    async getMeetingOrderInfoOfMyDetail () {
      var url = 'ConferenceRoom/GetMeetingOrderInfoOfMyDetail?VID=0&ID=' + this.ID
      const { data } = await this.$Http.get(url)
      this.form = data[0]
    },
    changeMeeting () {
      this.form.ID = this.ID
      this.$route.params.info = this.form;
      // this.$route.params.ID = this.ID;
      this.$router.push({ path: '/ExamineCRDateTimeFinished' })
    },
    goBack () {
      this.$router.go(-1);
    },
  }
}
</script>

<style lang="scss" scoped>
.title {
  padding: 20px 50px;
  font-size: 30px;
}
.context {
  padding: 20px 50px;
  font-size: 25px;
  color: #696969;
}
.submitButtom {
  position: fixed;
  bottom: 50px;
  width: 100%;
  height: 8%;
}
.el-page-header {
  line-height: 100px;
  height: 100px;
  background-color: #409eff;
  margin-bottom: 30px;
  color: white;
}
</style>
